package edu.hawaii.wattwaiter.page;

import org.apache.wicket.Request;
import org.apache.wicket.protocol.http.WebApplication;
import org.apache.wicket.protocol.http.WebSession;
import java.util.Date;

/**
 * Each user of the WattWaiter application is provided their own instance of WattWaiter.
 * 
 * This is a slightly modified version of the example code from Philip Johnson.
 * 
 * @author Kevin Chiogioji
 * @author Remy Baumgarten
 * @author David Mau
 * 
 * @version 2.0
 */

public class WattWaiterSession extends WebSession {
  /** Support serialization. */
  private static final long serialVersionUID = 1L;

  /** The start date for the gridinfo page associated with this user. */
  private String gridInfoStart = "";

  /** The end date for the gridinfo page associated with this user. */
  private String gridInfoEnd = "";

  /** The selected source for the gridinfo page associated with this user. */
  private String selectedSource = "";

  private Date date = new Date();

  private Date beginningDate = new Date();

  private Date endingDate = new Date();

  private Integer lastHourChecked = -1;

  private Integer currentColor = 2;
  
  private Boolean cumulative = false;
  
  private Boolean transitive = false;
  
  private String dropLocation = null;
  
  private String energyOrCarbon = null;
  
  private String timeFrame = null;
  
  private Boolean firstVisit = true;


  /**
   * Creates a new session for this user. Called automatically by wicket.
   * 
   * @param application This application.
   * @param request The request.
   */
  public WattWaiterSession(WebApplication application, Request request) {
    super(request);
  }

  /**
   * Returns the gridinfo start date for this user.
   * 
   * @return gridinfo start date
   */
  public String getGridInfoStart() {
    return gridInfoStart;
  }

  /**
   * Returns the gridinfo end date for this user.
   * 
   * @return gridinfo end date
   */
  public String getGridInfoEnd() {
    return gridInfoEnd;
  }

  /**
   * Returns the gridinfo selected source for this user.
   * 
   * @return gridinfo source
   */
  public String getSelectedSource() {
    return selectedSource;
  }

  /**
   * Getter.
   * 
   * @return date
   */
  public Date getDate() {
    return (Date) this.date.clone();
  }

  /**
   * Getter.
   * 
   * @return date
   */
  public Date getBeginningDate() {
    return (Date) this.beginningDate.clone();
  }

  /**
   * Getter.
   * 
   * @return date
   */
  public Date getEndingDate() {
    return (Date) this.endingDate.clone();
  }

  /**
   * Setter.
   * 
   * @param date - date
   */
  public void setDate(Date date) {
    this.date = (Date) date.clone();
  }

  /**
   * Setter.
   * 
   * @param date - date
   */
  public void setBeginningDate(Date date) {
    this.beginningDate = (Date) date.clone();
  }

  /**
   * Setter.
   * 
   * @param date - date
   */
  public void setEndingDate(Date date) {
    this.endingDate = (Date) date.clone();
  }

  /**
   * Getter.
   * 
   * @return lastHourChecked - Last hour looked up for stop light page
   */
  public Integer getLastHour() {
    return this.lastHourChecked;
  }

  /**
   * Getter.
   * 
   * @return currentColor - Color of stop light to be displayed for the current hour
   */
  public Integer getCurrentColor() {
    return this.currentColor;
  }

  /**
   * Setter.
   * 
   * @param hour - hour
   */
  public void setLastHour(Integer hour) {
    this.lastHourChecked = hour;
  }

  /**
   * Setter.
   * 
   * @param color - stop light color
   */
  public void setCurrentColor(Integer color) {
    this.currentColor = color;
  }

  /**
   * @param cumulative the cumulative to set
   */
  public void setCumulative(Boolean cumulative) {
    this.cumulative = cumulative;
  }

  /**
   * @return the cumulative
   */
  public Boolean getCumulative() {
    return cumulative;
  }

  /**
   * @param transitive the transitive to set
   */
  public void setTransitive(Boolean transitive) {
    this.transitive = transitive;
  }

  /**
   * @return the transitive
   */
  public Boolean getTransitive() {
    return transitive;
  }

  /**
   * @param dropLocation the dropLocation to set
   */
  public void setDropLocation(String dropLocation) {
    this.dropLocation = dropLocation;
  }

  /**
   * @return the dropLocation
   */
  public String getDropLocation() {
    return dropLocation;
  }

  /**
   * @param energyOrCarbon the energyOrCarbon to set
   */
  public void setEnergyOrCarbon(String energyOrCarbon) {
    this.energyOrCarbon = energyOrCarbon;
  }

  /**
   * @return the energyOrCarbon
   */
  public String getEnergyOrCarbon() {
    return energyOrCarbon;
  }

  /**
   * @param timeFrame the timeFrame to set
   */
  public void setTimeFrame(String timeFrame) {
    this.timeFrame = timeFrame;
  }

  /**
   * @return the timeFrame
   */
  public String getTimeFrame() {
    return timeFrame;
  }

  /**
   * @param firstVisit the firstVisit to set
   */
  public void setFirstVisit(Boolean firstVisit) {
    this.firstVisit = firstVisit;
  }

  /**
   * @return the firstVisit
   */
  public Boolean getFirstVisit() {
    return firstVisit;
  }

 

}
